import requests

if __name__ == '__main__':
    # 请求用户注册 get 用params

    # 如何指定get传参 定义字典
    user = {"username": "admin", "password": "123", "email": "861228389@qq.com", "phone": 120}
    resp = requests.get("http://127.0.0.1:8080/stest/user/regist.action", params=user)
    print(resp.text)
    #上面没有小括号叫做属性。下面这个有小括号叫做函数
    print(resp.json()["status"])
    #获取http响应的状态码
    print(resp.status_code)
    print(resp.headers)